package cn.tedu.baidashi.controller;

import cn.tedu.baidashi.service.Impl.CityServiceImpl;
import cn.tedu.baidashi.vo.CityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tedu.cn
 * @since 2022-02-16
 */
@RestController
@RequestMapping("/portal")
public class CityController {
    @Autowired
    CityServiceImpl cityService;

    @GetMapping("/{province_name}/city")
    public List<CityVo> getCityNames(
            @PathVariable String province_name
    ){
        List<CityVo> cityVos=cityService.getCityNames(province_name);
        return cityVos;
    }
}
